package com.team5101.dao;


import com.team5101.pojo.LagouAuthCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface LagouAuthCodeDao extends JpaRepository<LagouAuthCode,Long> {

    @Modifying
    @Query(value = "DELETE FROM lagou_auth_code WHERE email = ?1",nativeQuery = true)
    Integer removeByEmail(String email);

    @Query(value = "SELECT * FROM lagou_auth_code WHERE email = ?1 and code = ?2",nativeQuery = true)
    LagouAuthCode getByEmailAndCode(String email, String code);

}
